var bcrypt = require('bcryptjs')

// 生成密码
exports.encryption = function(e){
    console.log('--encryption--',e)
    let salt = bcrypt.genSaltSync(10);
    let hash = bcrypt.hashSync(e,salt)
    return hash;
}


// 解密
exports.verification = function(e,hash){
    console.log(e,hash)
    let verif = bcrypt.compareSync(e,hash);
    return verif;
}